import Router from 'koa-router'
import bodyParser from 'koa-bodyparser'
import { findAllControllers,regRoute } from './until.js'
import cors from 'koa-cors'


const router =new Router()

export const useControllers=function(app){

    app.use(cors())
    app.use(bodyParser())

    let controllers=findAllControllers()

    regRoute(router,controllers)

    app.use(router.routes())

}




